package edu.csl.study.coreserver2.service;

import lombok.extern.slf4j.Slf4j;

public class Test {

    public static void main(String[] args) {
        int b = 17;
        System.out.println("二进制输出"+Integer.toBinaryString(b));
        System.out.println("八进制输出"+Integer.toOctalString(b));
        System.out.printf("八进制输出"+"%010o\n",b);
        System.out.println("十六进制输出"+Integer.toHexString(b));
        System.out.printf("十六进制输出"+"%010x\n",b);

        System.out.println("b == 0x11 ："+(b == 0x11));//true
        System.out.println("2的十六进制输出"+Integer.toHexString(2));
        System.out.println("-2 的十六进制输出"+Integer.toHexString(-2));
        System.out.println("-2 == 0xfffffffe : "+(-2 == 0xfffffffe));//true

        int c = Double.valueOf(-1 * Math.pow(2,16)).intValue();
        System.out.println("-2的16次方 二进制输出"+Integer.toBinaryString(c));
        System.out.println("-2的16次方 十六进制输出"+Integer.toHexString(c));

        int a = 5;
        System.out.println(a<<1);//值是乘以2
        System.out.println(a<<2);//值是乘以4

        int b1 =-11;
        System.out.println(b1>>1);//值是除以2 向下取整
        System.out.println(b1>>2);//值是除以4 向下取整

        System.out.println(b1>>>1);//值是除以2 向下取整
        System.out.println(b1>>>2);//值是乘以4 向下取整

        String name2 = new String( "343434");
        System.out.println("1111-"+name2.hashCode());
        System.out.println("3333-"+say(name2).hashCode());

    }

    public static  String  say(String name){

        System.out.println("2222-"+name.hashCode());
        return name;
    }
}
